$(function() {
  var authCode = getQueryString("authCode");

  ajax.get("/register/activate", {
    // data: $(form).serialize(),
    data: { authCode: authCode },
    success: function(resp) {
      if (resp.ok == false) {
        layer.alert(resp.msg);
        $("#tip_msg").html(resp.msg);
      } else if (resp.ok) {
        // layer.alert(data.msg);
        $("#tip_msg").html(resp.msg);
        tiosite_show_login(1);

        // 把登录名填进输入框
        document.getElementById("tiosite_login_loginname").value = resp.data.loginname;
      }
    }
  });
});
